<?php

/**

 * [Fengxu!] (C)2008-2009 SSBT Inc.
 * This is NOT a freeware, use is subject to license terms
 * $Id: syscommon.inc.php Mon Apr 07 02:16:31 GMT 2008 $
 * @author fengxu qq:250484464 <zhiming0824@163.com>
 * @version $Id 02:16:31$
 * @license fengxu

 */

error_reporting(E_ALL&~E_NOTICE&~E_WARNING);

define('MCC_ROOT',dirname(__FILE__));

define('IN_MCC',TRUE);

require_once MCC_ROOT.'/include/global.inc.php';

$timezoneoffset = 8;
$timezoneoffset=$timezoneoffset>0 ? '-'.$timezoneoffset : '+'.$timezoneoffset;
function_exists('date_default_timezone_set') && date_default_timezone_set("Etc/GMT$timezoneoffset");

$defined_vars = get_defined_vars();

foreach ($defined_vars as $_key => $_value)

{

	if(!in_array($_key,array('_POST','_GET','GLOBALS','_FILES','_SERVER','_COOKIE','_SESSION')))

	{

		${$_key} = '';

		unset(${$_key});

	}

}

$t_array = explode(' ',microtime());

$systime = $t_array[0]+$t_array[1];

$timestamp = time();

get_magic_quotes_gpc()? define('MAGIC_QUOTES_GPC',TRUE) : define('MAGIC_QUOTES_GPC',FALSE);

if(!MAGIC_QUOTES_GPC)

{

	addslashes_deep($_POST);

	addslashes_deep($_GET);

	addslashes_deep($_COOKIE);

}

addslashes_deep($_FILES);

if($_SERVER['HTTP_X_FORWARDED_FOR'])

{

	$onlineip = $_SERVER['HTTP_X_FORWARDED_FOR'];

	$c_agentip = 1;

}elseif ($_SERVER['HTTP_CLIENT_IP'])

{

	$onlineip = $_SERVER['HTTP_CLIENT_IP'];

	$c_agentip = 1;

}elseif ($_SERVER['REMOTE_ADDR'])

{

	$onlineip = $_SERVER['HTTP_CLIENT_IP'];

	$c_agentip = 0;

}

require_once MCC_ROOT.'/config.inc.php';

import_request_variables('pgc');

if($uptype=='bakupds')

{

	$charset = '';

	$dbcharset = '';

}

require_once MCC_ROOT.'/include/db_mysql.class.php';

$dsdb = new dbstuff;
$dsdb->connect($dsdbhost, $dsdbuser, $dsdbpw, $dsdbname, $dspconnect);
$dsid = $dsdb;
$db = new dbstuff;
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
$dp = new dbstuff;
$dp->connect($dphost, $dpuser, $dppw, $dpname, $dppconnect);
$cacti = new dbstuff;
$cacti->connect($dbhost, $dbuser, $dbpw, $cactidb, $pconnect);
$_DCOOKIE = $_DSESSION =  array();

$prelength = strlen($cookiepre);

foreach($_COOKIE as $key => $val) {

	if(substr($key, 0, $prelength) == $cookiepre) {

		$_DCOOKIE[(substr($key, $prelength))] = MAGIC_QUOTES_GPC ? $val : addslashes_deep($val);

	}

}//把COOKIE里面的值过滤后倒入



$PHP_SELF = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];



?>